<template>
	<view>
        <view class="uni-list">
        	<view class="uni-list-cell uni-list-cell-pd">
                <view class="uni-list-cell-db">
                    value：{{data[0].value}}、禁止键盘输入
                </view>
                <numbox-shopping :value="data[0].value" disabled="true" index="0" @change="change"></numbox-shopping>
        	</view>
        	<view class="uni-list-cell uni-list-cell-pd">
                <view class="uni-list-cell-db">
                    max：{{data[1].value}}
                </view>
                <numbox-shopping :value="data[1].value" index="1" max="99" @change="change"></numbox-shopping>
        	</view>
        	<view class="uni-list-cell uni-list-cell-pd">
                <view class="uni-list-cell-db">
                    value：-1
                </view>
                <numbox-shopping value="-1" index="-1" @click="click">
                    到货提醒
                </numbox-shopping>
        	</view>
        	<view class="uni-list-cell uni-list-cell-pd">
                <view class="uni-list-cell-db">
                    value：-2
                </view>
                <numbox-shopping value="-2" index="-2" @click="click">
                    抢购
                </numbox-shopping>
        	</view>
        </view>
	</view>
</template>

<script>
    import numboxShopping from '@/components/wlp-number-shopping/wlp-number-shopping.vue';
	export default {
        components:{
            numboxShopping
        },
		data() {
			return {
				data: [
                    {
                        value: 0
                    },{
                        value: 99
                    }
                ]
			};
		},
		methods: {
			change(value, index) {
				this.data[index].value = value;
			},
			click(type) {
                if(type==-1){
                    uni.showToast({
                        title: '到货提醒',
                        duration: 1200
                    });
                }else{
                    uni.showToast({
                        title: '抢购',
                        duration: 1200
                    });
                }
			}
		}
	}
</script>

<style>
</style>
